﻿<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
	<meta charset="utf-8" />
    <script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            $.ajax({
                url: 'http://www.gov.cn/pushinfo/v150203/pushinfo.jsonp',
                dataType: "jsonp",
                jsonp: "pushInfoJsonpCallBack",
                jsonpCallback: "pushInfoJsonpCallBack",
                success: function (data) {
                    $.each(data, function (i, json) {
                        var newtitle;
                        mylength = json.title.length;
                        if (mylength > 22) {
                            newtitle = json.title.substring(0, 22) + "...";
                        } else {
                            newtitle = json.title;
                        }
                        if (i < 10) {                        
                            $("#testUl").append(" <tr height=\"25\"><td style=\"background-image: url(images/line.jpg);background-repeat: repeat-x;background-position: bottom\" width=\"4%\" align=\"center\">·</td><td style=\"background-image: url(images/line.jpg);background-repeat: repeat-x;background-position: bottom\"><a title='"+json.title+"' href='"+json.link+"' target=\"_blank\">"+newtitle+"</a></td> <td align=\"center\" style=\"background-image: url(images/line.jpg);background-repeat: repeat-x;background-position: bottom\">"+ json.pubDate +"</td></tr>");
                        }

                    })
                },
                error: function () {
                    $('#testDiv').text("加载错误！");
                }

            });

        })
    </script>  
</head>
<body>
    <div id="testUl">
        <table width="99%" border="0" cellspacing="0" cellpadding="0" align="center">
            <tbody id="testUl">
                
            </tbody>
        </table>
    </div>
</body>
</html>
